{% comment %}
<!--
  Copyright (C) 2008 ZHENG Zhong <http://www.zhengzhong.net/>

  Created on 2009-04-08.
  $Id$
-->
{% endcomment %}

<div id="best_dishes" class="ajax_box">

  <!-- main _____________________________________________________________________________________-->
  
  <div class="main">
    <span class="h3">Best dishes:</span>
    {% include "foodsnroses/ajax/ajax_error.html" %}
  </div>
  
  <!-- view _____________________________________________________________________________________-->
  
  <div class="view">
  
    <ul>
      {% if resto.best_dish_list %}
        {% for dish in resto.best_dish_list %}
          <li class="nowrap">
            <a href="{{webapp_}}/search/dish/?value={{dish|escape}}">{{dish|escape}}</a>
          </li>
        {% endfor %}
      {% else %}
        <li class="nowrap"><span class="na">N/A</span></li>
      {% endif %}
    </ul>
    
    {% if resto.is_manageable %}
      <div class="toggle_link">
        <a href="javascript:void(0);" onclick="toggleBox('#best_dishes');">[edit]</a>
      </div>
    {% endif %}
  
  </div><!--/.view-->
  
  <!-- edit _____________________________________________________________________________________-->
  
  {% if resto.is_manageable %}
  
    <div class="edit hidden">
    
      <form id="update_best_dishes_form" class="form" action="." method="POST"
            onsubmit="return submitAjaxForm('#best_dishes', '#update_best_dishes_form');">
        <input type="hidden" name="ajax_box" value="best_dishes"/>
        <div>
          <textarea type="text" name="best_dishes">{{resto.best_dishes|default:""|escape}}</textarea>
          <br/>
          <span class="help_text">One dish per line.</span>
        </div>
        <div>
          <input class="button" type="submit" value="Update"/>
          <input class="button" type="button" onclick="toggleBox('#best_dishes');" value="Cancel"/>
          <span class="ajax_indicator hidden">
            <img src="{{static_}}/images/ajax_indicator.gif" alt="AJAX Indicator"/>
          </span>
        </div>
      </form>
    
    </div><!--/.edit-->
  
  {% endif %}

</div><!--/#best_dishes-->


